global_defs {
   notification_email {
		$info["notificationemail"]		
   }
   notification_email_from $info["notificationemailfrom"]{LF}
   smtp_server $info["smtpserver"]{LF}
   smtp_connect_timeout $info["smtpconnecttimeout"]{LF}
   router_id $info["routerid"]{LF}
}
vrrp_instance VI_1 {
    state $info["state"]{LF}
    interface $info["iinterface"]{LF}
    virtual_router_id $info["virtualrouterid"]{LF}
    priority $info["priority"]{LF}
    advert_int $info["advertint"]{LF}
    authentication {
        auth_type $info["authtype"]{LF}
        auth_pass $info["authpass"]{LF}
    }
    virtual_ipaddress {
    {loop $vips $k $vip}
        $vip{LF}
	{/loop}
    }
}{LF}
{loop $vipports $k $vipport}
virtual_server $vipport["virtualipaddress"] $vipport["vport"] {
    delay_loop $vipport["delayloop"]{LF}
    lb_algo $vipport["lbalgo"]{LF}
    lb_kind $vipport["lbkind"]{LF}
    persistence_timeout $vipport["persistencetimeout"]{LF}
    protocol $vipport["protocol"]{LF}
    ha_suspend{LF}
	{loop $vipport["real"] $k1 $vinfo}
    real_server $vinfo["realip"] $vinfo["realport"] {
        weight $vinfo["weight"]{LF}
        {if ($vinfo["monitorstype"]=="HTTP_GET")}        
        HTTP_GET {
            url {
              path $vinfo["monitorspar1"]{LF}
              digest $vinfo["monitorspar2"]{LF}
            }
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
        }{LF}
        {elseif ($vinfo["monitorstype"]=="SSL_GET")}
        SSL_GET {
        	url{
        		path $vinfo["monitorspar1"]{LF}
              	digest $vinfo["monitorspar2"]{LF}
        	}{LF}
        	connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
        }{LF}
        {elseif ($vinfo["monitorstype"]=="TCP_CHECK")}
        TCP_CHECK {
        	connect_port $vinfo["monitorspar1"]{LF}
        	connect_timeout $vinfo["monitorspar2"]{LF}
        }{LF}
        {elseif ($vinfo["monitorstype"]=="SMTP_CHECK")}
        SMTP_CHECK {
        	host{
        		connect_port $vinfo["monitorspar1"]{LF}
        	}
        	connect_timeout $vinfo["monitorspar2"]{LF}
        	retry 3
        	delay_before_retry 3
        }{LF}
        {elseif ($vinfo["monitorstype"]=="MISC_CHECK")}
        MISC_CHECK {
        	misc_path $vinfo["monitorspar1"]{LF}
        	misc_timeout $vinfo["monitorspar2"]{LF}
        	misc_dynamic
        }{LF}
        {/if}
	}{LF}
    {/loop}
}{LF}
{/loop}
